{% extends 'base.html' %}

{% block content %}

<a href="{% url 'core:homework_create' %}" class="btn btn-primary mb-3"><i class="bi bi-plus-circle me-2"></i>布置作业</a>
<table class="table table-hover">
    <thead class="table-dark">
        <tr>
            <th>学科</th>
            <th>作业</th>
            <th>布置日期</th>
            <th>截止日期</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {% for homework in homeworks %}
        <tr>
            <td>{{ homework.class_subject }}</td>
            <td>{{ homework.content }}</td>
            <td>{{ homework.assigned_date }}</td>
            <td>{{ homework.due_date }}</td>
            <td>
                <a href="{% url 'core:homework_records_detail' homework.id %}" class="btn btn-sm btn-success"><i class="bi bi-eye me-1"></i>查看</a>
                <a href="{% url 'core:homework_update' homework.pk %}" class="btn btn-sm btn-warning"><i class="bi bi-pencil me-1"></i>编辑</a>
                <a href="{% url 'core:homework_delete' homework.pk %}" class="btn btn-sm btn-danger"><i class="bi bi-trash me-1"></i>删除</a>
                
            </td>
        </tr>
        {% empty %}
        <tr>
            <td colspan="5" class="text-center"><i class="bi bi-inbox me-2"></i>暂无作业记录</td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endblock %}